package viewControllers;

import java.util.ArrayList;

public class Animator {
	
	protected ArrayList<AnimationPart> parts;
	protected int frame = 0;
	protected boolean stoped =  false;
	
	public Animator(ArrayList<AnimationPart> parts){
		this.parts = parts;
	}
	
	public void reset(int frame){
		this.frame = frame;
	}
		
	public void reset(){
		reset(0);
	}
	
	public void play(){
		frame++;
		for (AnimationPart part : parts){
			part.play(frame);
			
		}
	}
	public boolean stoped(){
		return stoped;
	}

	public void stop() {
		stoped = true;
	}

}
